<template>
  <div>
    <Layout :total="total" :listQuery="listQuery" @search="getTableData">
      <template #btn>
        <el-button type="primary" @click="$router.push('/setSMS')" round>设置短信祝福</el-button>
      </template>
      <template #table="{height}">
        <SettingTable v-loading="loading" :height="height" :list="list" :tableData="tableData"></SettingTable>
      </template>
    </Layout>
  </div>
</template>

<script>
import { YGGH } from '../layout/config';
import Layout from '../layout/index.vue';
import SettingTable from '../layout/SettingTable.vue';
export default {
  name: 'employeeCare',
  components: { Layout, SettingTable },
  data() {
    return {
      tableData: [],
      list: YGGH,

      total: 0,
      listQuery: {
        PageSize: 50,
        PageIndex: 1
      },

      loading: false
    };
  },
  methods: {
    async getTableData(e) {
      this.loading = true;
      const params = { pageIndex: this.listQuery.PageIndex, pageSize: this.listQuery.PageSize, departments: [], employeeStatus: 0, nameOrJobOrPhone: '' };
      const { data } = await this.$api.optionsManage.GetEmployeeCarePage(e || params);
      this.tableData = data.data.data;
      this.total = data.data.total;
      this.loading = false;
    }
  },
  created() {
    this.getTableData();
  },
};
</script>

<style lang="less" scoped>
</style>
